from openai import OpenAI

def llm_local(message):
    client = OpenAI(
        base_url = 'http://192.168.2.4:11434/v1',
        api_key='ollama'
    )

    response = client.chat.completions.create(
        model="qwen3:4b",
        messages=message
    )
    return response.choices[0].message.content

if __name__ == '__main__':
    message = [
        {
            "role": "user", 
            "content": "今天兰州的天气怎么样？",
            # "stream": True
        }
    ]
    print(llm_local(message))